/*********************************************************************
	\file :           os_sw_layers\application\testapp\p1TestCases.c 
	\brief:           
	\author:          Manuel Sandoval
	\version:         1.0
	\date:            Sat, 01, March 2014
*********************************************************************/


/******************************* Includes**********************************/
#include "p1OsTickTestCases.h"

/******************************* Typedef **********************************/


/******************************* Defines **********************************/

/*!< Macros for PORT A */
#define LED_Port    	PORTA
#define D0         		1
#define D1         		2
#define D2         		4
#define D3         		8
#define D4         		16
#define D5         		32
#define D6         		64
#define D7         		128


/*!< Enable LED ON*/
#define LED_ON(BitMask)                     (LED_Port |= (u8)(BitMask))
/*!< Disable LED OFF*/
#define LED_OFF(BitMask)                    (LED_Port &= ~(u8)(BitMask))
/*!< Toggle LED */
#define LED_TOGGLE(BitMask)                 (LED_Port ^= (u8)(BitMask)) 


/*!< Ports redefinition for macros usability PORT A */
#ifndef PTA             
    #define PTA_PTA0 PORTA_PA0 
    #define PTA_PTA1 PORTA_PA1 
    #define PTA_PTA2 PORTA_PA2 
    #define PTA_PTA3 PORTA_PA3 
    #define PTA_PTA4 PORTA_PA4 
    #define PTA_PTA5 PORTA_PA5 
    #define PTA_PTA6 PORTA_PA6 
    #define PTA_PTA7 PORTA_PA7 
#endif

/*!< Data output register definition */
#define LOW             0
#define HIGH            1

/*!< Data Direction Register definitions */
#define INPUT           0
#define OUTPUT          1
#define ANALOG_INPUT    2


/******************************* Enumerations******************************/


/******************************* Structures *******************************/


/******************************* Global Variables **********************************/


/******************************* Prototypes ********************************/


/******************************* Functions ********************************/


/***************************************************************************
*
*   FUNCTION NAME: App_OsTickBlinkingLed
*
***************************************************************************/
/**
* @brief Test for Blinking the port A LED.
*
*
* @param[in].
*
* @return .
*
* @par Notification:
* None.
*
***************************************************************************/
void App_OsTickBlinkingLed(void)
{
    static u8 u8Counter = 0;
    
    /*!< Increment counter */
    u8Counter++;
         
    /*!< Toggle Led */
    LED_TOGGLE(D0);
}


/***************************************************************************
*
*   FUNCTION NAME: App_OsTickSetUpTest
*
***************************************************************************/
/**
* @brief Initialize the port A for the test.
*
*
* @param[in].
*
* @return .
*
* @par Notification:
* None.
*
***************************************************************************/
void App_OsTickSetUpTest(void)
{
	/*!< LED505, Port A, Channel 0, High */
    DDRA_DDRA0 = OUTPUT;             
    PTA_PTA0 = HIGH;       
}



/** @} *//* End of p1TestCases Group */

/*********************************************************************
	File	: os_sw_layers\application\testapp\p1TestCases.c 
*********************************************************************/
